package com.tangcheng.redislistener.expire.listener;

import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.connection.Message;
import org.springframework.data.redis.connection.MessageListener;

/**
 * @Auther: cheng.tang
 * @Date: 2023/10/17
 * @Description: redis-subject
 */
@Slf4j
public class CustomMessageListener implements MessageListener {

    public static final String CUSTOM_CHANNEL_PREFIX = "event:customer:channel:";

    @Override
    public void onMessage(Message message, byte[] pattern) {
        String channel = new String(message.getChannel());
        String body = new String(message.getBody());
        log.info(" channel {} body {} pattern {} ", channel, body, new String(pattern));
    }


}

